Skip to main content

Linked repositories

Insights Factory System has multiple integration points. Out of the box it’s shipped with integration to Meniga Digital Banking as a datasource and contains multiple repositories related to it.

note

Methods fetching data, defined in repositories, are provided to Bank Administrator while creating/updating insight definitions. They are also used by Triggering Engine to make proper evaluations of audience/triggering conditions and rendering message's content. For more information on repositories and their implementation, see Repositories section.

Transactions repository

Provides access to transaction history of a single user. User context is established in Triggering Engine when processing each incoming event.

Method signatureReturn typeDescription
Count(TransactionsFilter filter)intReturns number of transactions filling filter criteria.
SumAbsAmounts(TransactionsFilter filter)decimalReturns sum of amount absolute values of filtered transaction.
AvgAbsAmounts(TransactionsFilter filter)decimalReturns average of amount absolute values of filtered transaction.
CoefficientVariationAbsAmounts(TransactionsFilter filter)decimalReturns coefficient of variation of amount absolute values of filtered transaction
AvgSumAmountMonthly(TransactionsFilter filter)decimalReturns average of absolute values of amounts summed monthly.
MinSumAmountMonthly(TransactionsFilter filter)decimalReturns minimum of absolute values of amounts summed monthly.
MaxSumAmountMonthly(TransactionsFilter filter)decimalReturns maximum of the absolute values of amounts summed monthly.
GetHistoryStart(TransactionsFilter filter)DateTimeReturns date of the oldest of filtered transactions.
MinCountMonthly(TransactionsFilter filter)intReturns minimum of the count of transactions grouped monthly.
MaxCountMonthly(TransactionsFilter filter)intReturns maximum of the count of transactions grouped monthly.
GetTopSpendingCategories(TransactionsFilter filter, int count)List<Category>Returns a (count length) list of categories where the highest amount was spent.

Used types:

  • Transactions Filter

  public class TransactionsFilter
{
public DateTime? DateFrom { get; }
public DateTime? DateTo { get; }
public bool? IsExpense { get; }
public int[]? Categories { get; }
}
PropertyDescription
DateFromMinimal date (inclusive) of the transaction date to filter transactions by.
DateToMaximum date (inclusive) of the transaction date to filter transactions by.
IsExpensetrue if filtering for expenses is intended
CategoriesCollection of categories' identifiers to filter transactions by.
 public record Category
{
public int Id { get; init; }

public string Name { get; init; }

public int? ParentId { get; init; }

public string? ParentName { get; init; }

public int Type { get; init; }

public int ContextId { get; init; }

public bool UserCreated { get; init; }
}
PropertyDescription
IdUnique transactions category identifier.
NameCategory name.
ParentIdIdentifier of category group.
ParentNameName of category group.
TypeCategory type.
ContextIdIdentifier of the category context.
UserCreatedDetermines if category was created by a user.

Category repository

Provides information about categories.

Method signatureReturn typeDescription
GetCategories(int[] ids)List<Category>Returns a list of categories with given ids.
GetParentCategory(long categoryId)int?Returns identifier of the parent category of category with categoryId.
GetCategoryType(long categoryId)int?Returns category type identifier of category with categoryId.
GetCategoryContext(long categoryId)int?Returns category context identifier of category with categoryId.

DateTime calculations repository

Provides possibility to make calculations on DateTime.

Method signatureReturn typeDescription
AddInterval(DateTime dt, DateTimeInterval interval)DateTimeReturns calculated datetime. For example AddInterval(DateTime.Today, new {1, IntervalType.Day}) would return tomorrow's date.

Used types:

DateTimeInterval

   public class DateTimeInterval
{
public IntervalType Type { get; init; }
public int Quantity { get; init; }
}
PropertyDescription
TypeType of interval. Possible values are:'Day', 'Week', 'Month', 'Year'
QuantityNumber of intervals of given type

User repository

Allows to fetch User data. For person connected functions if user has multiple persons only first person's data is returned.

Method signatureReturn typeDescription
UserCreated()DateTimeReturns user's creation date.
UserIsInitialSetupDone()boolReturns information whether user's initial setup is completed.
UserPostalCode()string?Returns user's postal code.
UserMaritalStatus()int?Returns user's martial status.
UserNumberInFamily()int?Returns number of people living in user's household.
UserNumberOfKids()int?Returns number of user's children.
UserNumberOfCars()int?Returns number of cars in user's household.
UserIncome()int?Returns user's income class. Household income classification from low to high.
UserApartmentType()int?Returns user's apartment type.
UserApartmentSize()int?Returns user's apartment size.
UserApartmentRooms()int?Returns number of rooms in user's apartment.
UserCategoryContext()int?Returns category tree source context id.
UserCurrencyCode()stringReturns user's currency code.
PersonEmail()stringReturns email of the person assigned to the user.
PersonCreated()DateTimeReturns creation date of the person assigned to the user.
PersonLastLoginDate()DateTime?Returns date of the last login of person assigned to the user.
PersonCulture()stringReturns culture of the person assigned to the user.
PersonDateOfBirth()DateTime?Returns date of birth of the person assigned to the user.
PersonGender()int?Returns gender person assigned to the user.
PersonEmailConfirmed()boolReturns information if person's assigned to the user email is confirmed.
PersonIsPersonalSetupDone()boolReturns information if person's assigned to the user personal setup is completed.
PersonPasswordResetExpiration()DateTime?Returns password's reset expiration date of the person assigned to the user.
PersonTermsConditionsAcceptDate()DateTime?Returns terms of conditions acceptance date done by the person assigned to the user.
PersonOptOutDate()DateTime?Returns optout date done by the person assigned to the user.
PersonPhoneNumber()stringReturns phone number of the person assigned to the user.
PersonFirstName()stringReturns firstName of the person assigned to the user.
PersonLastName()stringReturns lastName of the person assigned to the user.
PersonPasswordExpiryDate()DateTime?Returns password's expiration date of the person assigned to the user.
PersonPasswordSetDate()DateTime?Returns password's set date of the person assigned to the user.